Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@tomusdrw
Copy link
Contributor

Closes #2263 #3033
Closes #1096

This PR introduces a way to customize and extend existing set of core RPCs with some additional methods that might be more runtime-specific.
It relies on not-yet-merged paritytech/jsonrpc#447 feature in JSON-RPC repo.

Extension is done inside ServiceFactory, and this breaks backward compatibility, since now you need to at least define an empty extension:
type RpcExtensions = () {}

As an example of custom RPC in node I've implemented account_nextNonce that takes into account nonces of transactions in the pending transaction pool (#2263).
Since current state nonce is only stored in the system module, I've added a custom RuntimeApi to expose that to rust code (#1096).

Additionality, the PR introduces node-testing crate that contains a test-client running on top of node-runtime.

Submitting as draft, as we still need to wait for new release of jsonrpc.

@tomusdrw tomusdrw added A0-please_review Pull request needs code review. M4-core labels Jul 12, 2019
@dvc94ch
Copy link
Contributor

dvc94ch commented Jul 20, 2019

If you rebase the test should pass... Denis fixed this in the gitlab.yml file.

@Tresdin-commander
Copy link

mark!

@tomusdrw tomusdrw marked this pull request as ready for review July 29, 2019 15:46
@gavofyork gavofyork added A3-needsresolving and removed A0-please_review Pull request needs code review. labels Aug 8, 2019
@gavofyork
Copy link
Member

one file left.

@tomusdrw tomusdrw added A0-please_review Pull request needs code review. and removed A3-needsresolving labels Aug 19, 2019
@gavofyork gavofyork merged commit db5f494 into master Aug 20, 2019
@gavofyork gavofyork deleted the td-custom-rpc branch August 20, 2019 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RPC to query nonce value includes one in the tx pool Provide example of adding an API and using it in the node

7 participants